package com.pigotech.ptwo.UI.CustomView;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.pigotech.ptwo.R;

/**
 * Created by ghb on 2018/1/12.
 */

public class CustomToast {
    private static TextView tv_toast_msg;

    public static void show(Context context, String message, int showTime) {

        View toastRoot = LayoutInflater.from(context).inflate(R.layout.custom_toast, null);
        tv_toast_msg = (TextView) toastRoot.findViewById(R.id.tv_toast_msg);
        tv_toast_msg.setText(message);
        Toast toast = new Toast(context);
        toast.setView(toastRoot);
        toast.setDuration(showTime);
        toast.show();

    }
}
